/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package program.utilities;

import java.util.Calendar;
import java.util.Date;

/**
 * Utility-class for date
 * 
 * @author Bernhard
 */
public class DateUtilities {

    /**
     * Returns date of the beginning of the month
     * 
     * @return date of the beginning of the month
     * 
     * Responsible: Johannes
     */
    public static Date getMonthBegin() {
        Date date = new Date();
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        c.set(Calendar.DAY_OF_MONTH, c.getActualMinimum(Calendar.DAY_OF_MONTH));
        return c.getTime();
    }

    /**
     * Returns date of the ending of the month
     * 
     * @return date of the ending of the month
     */
    public static Date getMonthEnd() {
        Date date = new Date();
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
        return c.getTime();
    }
}
